package com.ruicar.afs.cloud.apply.admin.manage.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.common.core.constant.CommonConstants;
import com.ruicar.afs.cloud.common.core.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;


/**
 * The type SysDepartment.
 * <p>
 * Created on 2019-02-21
 *
 * @author Fzero
 */
@Data
@TableName("sys_department")
@ApiModel(value = "部门")
public class SysDepartment extends BaseEntity<SysDepartment> {

    /**
     * The constant serialVersionUID.
     */
    private static final long serialVersionUID = 1L;

    /**
     * The Title.
     */
    @ApiModelProperty(value = "部门名称")
    private String title;

    /**
     * The Parent id.
     */
    @ApiModelProperty(value = "父id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;

    /**
     * The Is parent.
     */
    @ApiModelProperty(value = "是否为父节点(含子节点) 默认false")
    private Boolean isParent = false;

    /**
     * The Sort order.
     */
    @ApiModelProperty(value = "排序值")
    private BigDecimal sortOrder;


    private String tenantId;
    /**
     * The Status.
     */
    @ApiModelProperty(value = "是否启用 1启用 0禁用")
    private String status = CommonConstants.STATUS_NORMAL;

    @ApiModelProperty(value = "渠道id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long channelId;
    /**
     * The Parent title.
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "父节点名称")
    private String parentTitle;


    /**
     * 新车授权区域
     */
    @TableField(exist = false)
    private List<SysDeptAuthRegion> newCarRegion;
    /**
     * 二手车授权区域
     */
    @TableField(exist = false)
    private List<SysDeptAuthRegion> oldCarRegion;
}
